import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from "./router/router";
import axios from "axios";
import Lazyload from "vue3-lazyload";
import JSONBIG from 'json-bigint'

const app = createApp(App);
app.use(ElementPlus)
app.use(router)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
//注册插件
app.use(Lazyload, {
    loading: "@/assets/images/default.png",//可以指定加载中的图像
    error: "@/assets/images/err.png",//可以指定加载失败的图像
});

// 解决前端处理19位id精度失效问题
axios.defaults.transformResponse = [
    function (data) {
        const json = JSONBIG({
            storeAsString: true
        })
        const res = json.parse(data);
        return res;
    }
]

app.mount('#app')
